#include<stdio.h>

typedef struct Elenemt_data
{
    char name[128]; // 名字
    char sex[64];   // 性别
    int age;        // 年龄
    int id;         // 学号
    int sco;        // 成绩
} Elenemt_data;


int main(int argc, char const *argv[])
{
    Elenemt_data ybc[128] = 
    {
        {.id = 1, .age = 18, .sco = 100, .sex = "男", .name = "唐三"},
        {.id = 2, .age = 18, .sco = 99, .sex = "男", .name = "萧炎"},
        {.id = 3, .age = 18, .sco = 99, .sex = "男", .name = "叶晨"},
        {.id = 4, .age = 18, .sco = 99, .sex = "女", .name = "小舞"},
        {.id = 5, .age = 18, .sco = 99, .sex = "女", .name = "萧熏儿"},
        {.id = 6, .age = 18, .sco = 99, .sex = "女", .name = "柳如烟"},
    };

    FILE * fp = fopen("hello.txt" , "w");

    for (int i = 0; i < 6; i++)
    {
        fprintf(fp , "学号:%d\t年龄:%d\t成绩:%d\t性别:%s\t姓名:%s\n" , 
        ybc[i].id,ybc[i].age,ybc[i].sco,ybc[i].sex,ybc[i].name
        );
    }
    
    return 0;
}




